package com.nobradovic83.pygsto.domainmodel.beans;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import com.nobradovic83.pygsto.core.beans.BaseBean;
import com.nobradovic83.pygsto.domainmodel.Order;
import com.nobradovic83.pygsto.domainmodel.OrderDetail;
import com.nobradovic83.pygsto.domainmodel.Product;
@Entity
public class OrderDetailBean extends BaseBean implements OrderDetail{
	private int quantity;
	private Order order;
	private Product product;
	
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	public void setOrder(Order order) {
		this.order = order;
	}
	@ManyToOne(cascade={CascadeType.ALL},targetEntity=OrderBean.class)
	public Order getOrder() {
		return order;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	@ManyToOne(cascade={CascadeType.ALL},targetEntity=ProductBean.class)
	public Product getProduct() {
		return product;
	}
}
